<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
	<meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, bootstrap, front-end, frontend, web development">
	<meta name="author" content="秀杰">
	<title>航班订阅系统Demo</title>
	<!-- Bootstrap core CSS -->
	<link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
	<!-- Optional Bootstrap Theme -->
	<link href="data:text/css;charset=utf-8," data-href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" rel="stylesheet" id="bs-theme-stylesheet">
	<link href="http://v3.bootcss.com/assets/css/patch.css" rel="stylesheet">
	<!-- Documentation extras -->
	<link href="http://v3.bootcss.com/assets/css/docs.min.css" rel="stylesheet">
	<!--[if lt IE 9]><script src="http://v3.bootcss.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
	<script src="http://v3.bootcss.com/assets/js/ie-emulation-modes-warning.js"></script>
	<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
	<!--[if lt IE 9]>
	<script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
	<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->

	<!-- Favicons -->
	<link rel="apple-touch-icon" href="/apple-touch-icon.png">
	<link rel="icon" href="/favicon.ico">
	<script>
		var _hmt = _hmt || [];
	</script>
</head>
<body>
<a id="skippy" class="sr-only sr-only-focusable" href="#content"><div class="container"><span class="skiplink-text">Skip to main content</span></div></a>

<!-- Docs master nav -->
<header class="navbar navbar-static-top bs-docs-nav" id="top" role="banner">
	<div class="container">
		<div class="navbar-header">
			<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#bs-navbar" aria-controls="bs-navbar" aria-expanded="false">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a href="<?php echo xj_site_url('/');?>" class="navbar-brand">航班订阅系统Demo</a>
		</div>
		<nav id="bs-navbar" class="collapse navbar-collapse">
			<ul class="nav navbar-nav">
				<li class="active">
					<a href="<?php echo xj_site_url('/');?>" onclick="_hmt.push(['_trackEvent', 'docv3-navbar', 'click', '我的订阅'])">我的订阅</a>
				</li>
				<li >
					<a href="<?php echo xj_site_url('/index/0/add');?>" onclick="_hmt.push(['_trackEvent', 'docv3-navbar', 'click', '添加订阅'])">添加订阅</a>
				</li>
				<li>
					<a href="<?php echo xj_site_url('/index/0/msg');?>" onclick="_hmt.push(['_trackEvent', 'docv3-navbar', 'click', '我的消息'])">我的消息</a>
				</li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li><a href="http://git.oschina.net/UtilityClass/XJPHP-RESTful" onclick="_hmt.push(['_trackEvent', 'docv3-navbar', 'click', 'XJPHP'])" target="_blank">XJPHP-RESTful</a></li>
			</ul>
		</nav>
	</div>
</header>

<!-- Docs page layout -->
<div class="bs-docs-header" id="content" tabindex="-1">
	<div class="container">
		<h1>航班订阅</h1>
		<p>我的订阅</p>
	</div>
</div>

<div class="container bs-docs-container">

	<div class="row">
		<div class="col-md-3" role="complementary">

			<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm">
				<ul class="nav bs-docs-sidenav">
					<li><a href="#my_dy">我的订阅</a></li>
					<li><a href="<?php echo xj_site_url('/index/0/add');?>">添加订阅</a></li>
					<li><a href="<?php echo xj_site_url('/index/0/msg');?>">我的消息</a></li>
				</ul>
				<a class="back-to-top" href="#top">
					返回顶部
				</a>
			</nav>
		</div>
		<div class="col-md-9" role="main">

			<div class="bs-docs-section">
				<h1 id="my_dy" class="page-header">我的订阅</h1>
				<table class="table table-hover table-bordered">
					<thead>
					<tr class="bg-primary">
						<th>航班号</th>
						<th>出发地机场</th>
						<th>目的地机场</th>
						<th>航班日期</th>
						<th>订购类型</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
					<?php
					$sub_typeArr = array(
						"0"=>"乘机",
						"1"=>"接机"
					);
					$arrportArr = array(
						"PEK" => "北京-北京首都国际机场",
						"SHA" => "上海-上海虹桥机场",
						"PVG" => "上海-上海浦东机场",
						"CAN" => "广州-广州白云机场",
						"SZX" => "深圳-深圳宝安国际机场",
						"CTU" => "成都-成都双流机场",
						"HAK" => "海口-海口美兰机场",
						"NKG" => "南京-南京禄口机场",
						"CKG" => "重庆-重庆江北机场",
						"XIY" => "西安-西安咸阳机场",
						"CSX" => "长沙-长沙黄花机场",
						"HGH" => "杭州-杭州萧山机场",
						"HRB" => "哈尔滨-哈尔滨太平机场",
						"SYX" => "三亚-三亚凤凰机场",
						"KMG" => "昆明-昆明巫家坝机场",
						"XMN" => "厦门-厦门高崎机场",
						"DLC" => "大连-大连周水子机场",
						"WUH" => "武汉-武汉天河机场",
						"TAO" => "青岛-青岛流亭机场",
						"URC" => "乌鲁木齐-乌鲁木齐地窝铺机场",
						"TNA" => "济南-济南遥墙机场",
						"NNG" => "南宁-南宁吴圩机场",
						"TSN" => "天津-天津滨海机场",
						"SHE" => "沈阳-沈阳桃仙机场",
						"KWE" => "贵阳-贵阳龙洞堡机场",
						"KWL" => "桂林-桂林两江机场",
						"WNZ" => "温州-温州永强机场",
						"FOC" => "福州-福州长乐机场",
						"TYN" => "太原-太原武宿机场",
						"NGB" => "宁波-宁波栎社机场",
						"WUA" => "乌海-乌海机场",
						"FNJ" => "平壤-顺安机场(ENJ)",
						"ULN" => "乌兰巴托-",
						"LNJ" => "临沧-临沧机场",
						"JJN" => "泉州-泉州晋江机场",
						"ACX" => "兴义-",
						"PZI" => "攀枝花-",
						"DLU" => "大理-大理机场",
						"NAY" => "北京南苑-北京南苑机场",
						"TCG" => "塔城-塔城机场",
						"DIG" => "迪庆-迪庆机场",
						"HDG" => "邯郸-河北邯郸机场",
						"DSN" => "鄂尔多斯-鄂尔多斯机场",
						"XNT" => "邢台-",
						"LXI" => "林西-",
						"AEB" => "百色-百色机场",
						"FUO" => "佛山-",
						"HUZ" => "惠州-",
						"LHK" => "光化-",
						"YUA" => "元谋-元谋机场",
						"WNH" => "文山-",
						"JNG" => "济宁-济宁机场",
						"PNJ" => "蓬莱-",
						"RUG" => "如果-",
						"WHU" => "芜湖-",
						"LCX" => "连城-连城机场",
						"BPX" => "昌都-昌都邦达机场",
						"DZU" => "大足-大足登云机场",
						"SXJ" => "膳善-",
						"AOG" => "鞍山-鞍山机场",
						"CNI" => "长海-",
						"FUD" => "绥芬河-",
						"TNH" => "通化-通化机场",
						"XEN" => "兴城-",
						"KGT" => "康定-康定机场",
						"ZHY" => "中卫-宁夏中卫香山机场",
						"TCZ" => "腾冲-云南腾冲驼峰机场",
						"OHE" => "漠河-漠河机场",
						"KHN" => "南昌-南昌昌北机场",
						"CGQ" => "长春-长春龙嘉机场",
						"CGO" => "郑州-郑州新郑机场",
						"LHW" => "兰州-兰州中川机场",
						"HFE" => "合肥-合肥骆岗机场",
						"ZUH" => "珠海-珠海三灶机场",
						"YNT" => "烟台-烟台莱山机场",
						"SJW" => "石家庄-石家庄正定机场",
						"INC" => "银川-银川河东机场",
						"SWA" => "汕头-汕头外砂机场",
						"HET" => "呼和浩特-呼和浩特白塔机场",
						"LXA" => "拉萨-拉萨贡嘎机场",
						"YNJ" => "延吉-延吉朝阳川机场",
						"YIH" => "宜昌-宜昌三峡机场",
						"LJG" => "丽江-丽江三义机场",
						"MIG" => "绵阳-绵阳莱坝机场",
						"XNN" => "西宁-西宁曹家堡机场",
						"WUS" => "武夷山-武夷山机场",
						"CZX" => "常州-常州奔牛机场",
						"SZV" => "苏州-苏州光福机场",
						"ZHA" => "湛江-湛江机场",
						"DYG" => "张家界-张家界大庸荷花机场",
						"TXN" => "黄山-黄山屯溪机场",
						"JMU" => "佳木斯-佳木斯机场",
						"JNZ" => "锦州-锦州小岭子机场",
						"BAV" => "包头-包头二里半机场",
						"BHY" => "北海-北海福城机场",
						"NTG" => "南通-南通兴东机场",
						"YIW" => "义乌-义乌机场",
						"WEH" => "威海-威海文登大水泊机场",
						"YTY" => "扬州泰州-扬州国际机场",
						"NAO" => "南充-南充高坪机场",
						"CGD" => "常德-常德桃花源机场",
						"AVA" => "安顺-安顺黄果树机场",
						"XUZ" => "徐州-徐州观音机场",
						"LYG" => "连云港-连云港白塔埠机场",
						"MDG" => "牡丹江-牡丹江海浪机场",
						"YNZ" => "盐城-江苏盐城南洋机场",
						"DNH" => "敦煌-敦煌机场",
						"BFU" => "蚌埠-蚌埠机场",
						"ENH" => "恩施-恩施机场",
						"XFN" => "襄樊-襄樊刘集机场",
						"YBP" => "宜宾-宜宾宜宾高坪机场",
						"DDG" => "丹东-丹东浪头机场",
						"JJN" => "晋江-泉州晋江机场",
						"NDG" => "齐齐哈尔-齐齐哈尔三家子机场",
						"AQG" => "安庆-安庆天柱山机场",
						"BSD" => "保山-保山云瑞机场",
						"LYA" => "洛阳-洛阳机场",
						"LZO" => "泸州-泸州机场",
						"KRL" => "库尔勒-库尔勒机场",
						"LZH" => "柳州-柳州白莲机场",
						"CIF" => "赤峰-赤峰土城子机场",
						"LYI" => "临沂-临沂沐埠岭机场",
						"HLD" => "海拉尔-内蒙古海拉尔东山机场",
						"HYN" => "黄岩-台州黄岩路桥机场",
						"UYN" => "榆林-榆林西沙机场",
						"FUG" => "阜阳-阜阳西关机场",
						"SHP" => "秦皇岛-秦皇岛机场",
						"JHG" => "西双版纳-景洪西双版纳机场",
						"JZH" => "九寨沟-九寨沟黄龙(九黄）机场",
						"DAX" => "达县-达县机场",
						"HSN" => "舟山-舟山普陀山朱家尖机场",
						"NNY" => "南阳-南阳姜营机场",
						"JUZ" => "衢州-衢州机场",
						"JIL" => "吉林-吉林二台子机场",
						"KCA" => "库车-库车机场",
						"JGN" => "嘉峪关-嘉峪关机场",
						"JDZ" => "景德镇-景德镇罗家机场",
						"HZG" => "汉中-汉中西关机场",
						"TGO" => "通辽-通辽机场",
						"WUZ" => "梧州-梧州长洲岛机场",
						"GOQ" => "格尔木-格尔木机场",
						"JIU" => "九江-九江庐山机场",
						"KRY" => "克拉玛依-克拉玛依克拉玛依",
						"AKU" => "阿克苏-阿克苏机场",
						"KHG" => "喀什-喀什机场",
						"AKA" => "安康-安康机场",
						"DAT" => "大同-大同机场",
						"ENY" => "延安-延安二十里铺机场",
						"KOW" => "赣州-赣州黄金机场",
						"SYM" => "思茅-思茅机场",
						"ZAT" => "昭通-昭通机场",
						"HEK" => "黑河-黑河机场",
						"JGS" => "井冈山-井冈山机场",
						"GYS" => "广元-",
						"HTN" => "和田-和田机场",
						"LUM" => "芒市-芒市机场",
						"CIH" => "长治-长治机场",
						"XIC" => "西昌-西昌青山机场",
						"LZY" => "林芝-林芝机场",
						"YIN" => "伊宁-伊宁机场",
						"DOY" => "东营-东营机场",
						"MXZ" => "梅县-梅县机场",
						"SHS" => "沙市-荆州沙市机场",
						"HLH" => "乌兰浩特-乌兰浩特机场",
						"CHG" => "朝阳-朝阳机场",
						"GHN" => "广汉-广汉机场",
						"XIL" => "锡林浩特-锡林浩特机场",
						"IQM" => "且末-且末机场",
						"WEF" => "潍坊-潍坊机场",
						"WUX" => "无锡-无锡硕放机场",
						"THQ" => "天水-天水机场",
						"AAT" => "阿勒泰-阿勒泰机场",
						"WXN" => "万州-万州五桥机场",
						"NLT" => "新源-那拉提",
						"YCU" => "运城-运城关公机场",
						"HJJ" => "怀化-怀化芷江机场",
					);
					foreach($dy_data as $row) {
						?>
						<tr>
							<th scope="row"><?php	echo $row['flightid'];	?></th>
							<td><?php
								echo $row['fromairport'];
								if(isset($arrportArr[$row['fromairport']]))
									echo ' - '.$arrportArr[$row['fromairport']];
								?></td>
							<td><?php	echo $row['toairport'];
								if(isset($arrportArr[$row['toairport']]))
									echo ' - '.$arrportArr[$row['toairport']];
								?></td>
							<td><?php	echo $row['flydate'];	?></td>
							<td><?php	echo $sub_typeArr[$row['sub_type']];	?></td>
							<td>
								<button type="button" class="btn btn-danger btn-xs my_but_del"
										id="my_but_del_<?php	echo $row['id'];	?>"
										title="<?php	echo $row['flightid'];	?>">
									删除
								</button>
							</td>
						</tr>
						<?php
					}
					?>
					</tbody>
				</table>
			</div>
		</div>

	</div>
</div>

<!-- Footer
================================================== -->
<footer class="bs-docs-footer" role="contentinfo">
	<div class="container">

		<p></p>
		<ul class="bs-docs-footer-links text-muted">
			<li>当前版本：<?php echo $_ENV['XJ_PHP']; ?> <?php echo $_ENV['XJ_VERSION']; ?></li>
			<li>&middot;</li>
		</ul>
	</div>
</footer>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="http://v3.bootcss.com/assets/js/docs.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="http://v3.bootcss.com/assets/js/ie10-viewport-bug-workaround.js"></script>
<!-- Analytics
================================================== -->
<script type="text/javascript">
	jQuery(document).ready(function () {
		$('.my_but_del').bind('click', function () {
			title = $(this).attr('title');
			id = $(this).attr('id');
			//alert(id);
			id = id.substr(11);
			//alert(id);
			if (confirm("确认删除 航班号【" + title + "】 吗？")){
				$.get("<?php echo xj_site_url('/');?>index/"+id+"/del", function(data){
					if (data == 'ok'){
						alert('处理成功!');
						location.replace(location.href);
					}else{
						alert('处理失败!');
					}
				});
			}
		});
	});
	
</script>

<!-- 全局统计代码 -->
<script type="text/javascript">
</script>
</body>
</html>
